const fs = window.require('fs').promises
const path = require('path')

export const readFile = (path) => {
    return fs.readFile(path, 'utf-8')
}

export const writeFile = (path, content) => {
    return fs.writeFile(path, content, 'utf-8')
}

export const renameFile = (path,newPath)=>{
    return fs.rename(path,newPath)
}

export const deleteFile = (path) => {
    return fs.unlink(path)
}

readFile(path.join(__dirname, 'main.js')).then((res) => {
    console.log(res)
})
